<template>
  <div>
    <breadcrumbs :data1="data1" :data2="data2"></breadcrumbs>
    <el-card>
      <el-table :data="rightslist" stripe border style="width: 100%">
        <el-table-column type="index" label="序号" width="60"></el-table-column>
        <el-table-column prop="authName" label="权限管理"></el-table-column>
        <el-table-column prop="path" label="路径"></el-table-column>
        <el-table-column prop="level" label="等级">
            <template slot-scope="scope">
                <!-- <el-tag>{{scope.row.level=='0'?'一级':scope.row.level=='1'?'二级':scope.row.level=='2'?'三级':'' }}</el-tag>  -->
                <el-tag v-if="scope.row.level=='0'" type="danger">一级</el-tag>
                <el-tag v-else-if="scope.row.level=='1'" type="warning">二级</el-tag>
                <el-tag v-else type="success">三级</el-tag>
            </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
           
<script>
import breadcrumbs from '@/common/breadcrumbs'
export default {
  data () {
    return {
      data1: '权限管理',
      data2: '权限列表',
      rightslist: []
    }
  },
  components: {
    breadcrumbs
  },
  created () {
    this.getRights()
  },
  methods: {
    async getRights () {
      const { data: res } = await this.$http.get(`rights/list`)
      // console.log(res)
      this.rightslist = res.data
    }
  }

}
</script>
<style scoped>
</style>